<template>
    <div class="shopCar">
        <div class="top" style="over-flow:hidden;">
            <img :src="require('@/assets/shop/back.png')" alt="" class="back" @click="$router.go(-1)" />
            <div class="p" style="text-align:center;width:100%;margin-left:-10%;line-height:20px;">全部评价</div>
        </div>
        <div class="bar">
            <div class="right">
                <!-- 列表 -->
                <div class="list" style="background:#f2f2f2">
                    <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad" :immediate-check="false">
                        <div class="item" v-for="(k, index) in list" :key="index" >
                            <img v-lazy="checkPic(k.PIC1)" alt="" class="item-img" />
                 
                            <div class="pro">
                                <div class="title">昵称: {{ k.USER_ID_NAME}}</div>
                                <div class="type">评分:
                                    <span>{{ k.POINT }}</span>
                                </div>
                                <div class="title">
                                    时间:{{ k.ADD_TIME }}
                                </div>
                                <div class="title">内容：
                                    <span>{{ k.CONTENT }}</span>
                                </div>
                            </div>
                        </div>
                    </van-list>
                </div>
            </div>
        </div>
        <!-- 底部栏 -->
        <v-footer2 background="#f2f2f2"></v-footer2>
    </div>
</template>
<script>
import "@/css/shop/main.scss";
import "@/css/shop/comment.scss";
import Footer2 from "@/common/travel/_footer2.vue";
import Util from "../../util/common";
import { Toast } from 'vant'
export default {
    components: {
        "v-footer2": Footer2,
    },
    data() {
        return {
            name: "",
            value1: "",
            value2: "",
            activeKey: 0,
            active: 2,
            // tag
            optionValue: {
                id: "",
            },
            list: [],
            loading: false,
            finished: false,
            pageNum: 0,
            // 左边
            allData: [{ list: [{ list: [] }] }],
            Sortid: 0,
        };
    },
    created() {
        this.onLoad();
        this.activeKey = this.$store.state.category.tabIndex;
    },

    methods: {

        onSubmit() { },
        //点击选项

        checkPic: function (picurl) {
            return this.$conf.domain + "/" + picurl;
        },

        // 左边导航栏切换
        sideChange(i) {
            this.$store.commit("CHANGE_TABINDEX", i);
        },
        onLoad() {
            //this.loading=true;
            this.$dopost(
                "/sysapi/comment/list/",
                {
                    viewloading: 0,
                    to_id: this.$route.query.to_id,//25828 this.pageid
                    module: 5,
                    page: this.pageNum + 1,
                },
                function (res) {
                    if (
                        res.data &&
                        typeof res.data.error != "undefined" &&
                        res.data.error === 0
                    ) {
                        for (let i = 0; i < res.data.data.length; i++) {
                            this.list.push(res.data.data[i]);
                        }
                        this.pageNum = parseInt(res.data.data.page);

                        if (
                            parseInt(res.data.data.page) >= parseInt(res.data.data.allpage)
                        ) {
                            this.finished = true;
                        }
                        this.loading = false;

                    } else {
                        Toast(res.data && res.data.mess ? res.data.mess : "接口555错误");
                    }
                }.bind(this)
            );
        },
     
     
    
    },
};
</script>
